#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using vec = vector < int >;
using ll = long long;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 2e6 + 10;

int n,a[N],ans[N];

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	n = in; rep(i, 0, n - 1) a[i] = in << 1;
	auto r = [](int x) { return (x + 1) % n; };
	bool t = true;
	memset(ans,-1,sizeof ans);
	rep(i, 0, n - 1) {
		int j = r(i);
		if(a[i] * 2 < a[j]) ans[i] = j,a[j] >>= 1,t = false;
		else if(a[i] > a[j] * 2) ans[i] = i,a[i] >>= 1,t = false;
	}
	per(i, n - 1, 0) {
		if(~ans[i]) continue; int j = r(i);
		if(a[i] * 2 < a[j]) ans[i] = j,a[j] >>= 1,t = false;
		else if(a[i] > a[j] * 2) ans[i] = i,a[i] >>= 1,t = false;
	}
	if(t) { rep(i, 1, n) printf("%d ",i); return 0; }
	int pt = 0;
	rep(i, 0, n - 1) if(~ans[i]) { pt = i; break; }
	rep(i, n, n + n - 1) a[i] = a[i - n];
	rep(i, pt, pt + n - 1) {
		if(~ans[i % n]) continue; int j = i + 1,pos = i; while(j <= n + pt - 1 && !~ans[j % n]) j++; j--;
		rep(k, i, j + 1) if(a[k] < a[pos]) pos = k;
		rep(k, i, pos - 1) ans[k % n] = k % n;
		rep(k, pos, j) ans[k % n] = r(k % n);
		i = j;
	}
	rep(i, 0, n - 1) printf("%d%c",ans[i] + 1," \n"[i == n]);
	return 0;
}
